package com.lorenzogao.pley.ui.data


import com.lorenzogao.pley.bean.AppInfo
import com.lorenzogao.pley.bean.BaseBean
import com.lorenzogao.pley.bean.IndexBean
import com.lorenzogao.pley.bean.PageBean
import com.lorenzogao.pley.ui.data.http.ApiService
import io.reactivex.Observable


/**
 * Created by GanLanPing
 * data:2017/12/23
 * time:13:34
 * 邮箱:2508719070@qq.com
 * Description:
 */

class AppInfoModel(private var apiService: ApiService) {

    private var mApiService: ApiService = apiService


    fun getApps(): Observable<BaseBean<PageBean<AppInfo>>> {
        return mApiService.getApps("{'page':0}")
    }


    fun index(): Observable<BaseBean<IndexBean>> {
        return mApiService.index()
    }

    fun toplist(page: Int): Observable<BaseBean<PageBean<AppInfo>>> {
        return mApiService.toplist(page)
    }

    fun games(page: Int): Observable<BaseBean<PageBean<AppInfo>>> {
        return mApiService.games(page)
    }


    fun getFeaturedAppByCategory(category: Int, page: Int): Observable<BaseBean<PageBean<AppInfo>>> {
        return mApiService.getFeaturedAppByCategory(category, page)
    }


    fun getTopListAppByCategory(category: Int, page: Int): Observable<BaseBean<PageBean<AppInfo>>> {
        return mApiService.getTopListAppByCategory(category, page)
    }


    fun getNewListAppByCategory(category: Int, page: Int): Observable<BaseBean<PageBean<AppInfo>>> {
        return mApiService.getNewListAppByCategory(category, page)
    }

    fun getAppDetail(id: Int): Observable<BaseBean<AppInfo>> {
        return mApiService.getAppDetail(id)
    }


}
